package com.epfly.iface.promo.activity;

import com.epfly.iface.promo.activity.vo.GetDiscountAndLockAmountRequest;
import com.epfly.iface.promo.activity.vo.RollbackDiscountAmountRequest;
import com.epfly.iface.promo.activity.vo.UnlockDiscountAmountRequest;
import com.epfly.iface.promo.activity.vo.UseDiscountAmountRequest;

public interface ActivityOrderService {

    /**
     * 支付前
     * 锁定可享受折扣金额
     * note: 用户级加锁, 必须和"创建订单"在同一个事务,即：订单创建成功的同时，锁定已享受优惠。
     *
     */
    void getAndLockDiscountAmount(GetDiscountAndLockAmountRequest request);

    /**
     * 支付失败或取消支付
     * 解锁可享受折扣金额
     */
    void unlockDiscountAmount(UnlockDiscountAmountRequest request);

    /**
     * 支付成功
     */
    void useDiscountAmount(UseDiscountAmountRequest request);

    /**
     * 退款
     */
    void rollbackDiscountAmount(RollbackDiscountAmountRequest request);
}
